package 实践.class_05;

import java.util.Scanner;

public class Demo_03 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        System.out.println(isPalindrome(n));
        in.close();
    }

//    private static boolean isPalindrome(int n) {
//        boolean flag = false;
//        while (n > 0) {
//
//        }
//        return flag;
//
//    }
    private static boolean isPalindrome(int n) {
        if (n < 0 || (n % 10 == 0 && n != 0)) {
            return false;
        }
        int reversedNumber = 0;
        while (n > reversedNumber) {
            reversedNumber = reversedNumber * 10 + n % 10;
            n /= 10;
        }
        return n == reversedNumber || n == reversedNumber / 10;
    }
}
